package database;

import runtime.*;

public final class DatabaseObjectFactory implements RuntimeInstanceFactory {
    public static final String NUMBER = "DatabaseNumber";
    public static final String TEXT = "DatabaseText";
    public static final String DATE = "DatabaseDate";
    public static final String FLOAT = "DatabaseFloat";
    public static final String EMAIL = "DatabaseEmail";
    public static final String PHONE = "DatabasePhone";

    @Override
    public RuntimeInstance getObject(String typeName) {
        if (typeName.equals(NUMBER)) {
            return new DatabaseNumber();
        }
        if (typeName.equals(TEXT)) {
            return new DatabaseText();
        }
        if (typeName.equals(EMAIL)) {
            return new DatabaseEmail();
        }
        if (typeName.equals(PHONE)) {
            return new DatabasePhone();
        }
        if (typeName.equals(DATE)) {
            return new DatabaseDate();
        }
        if (typeName.equals(FLOAT)) {
            return new DatabaseFloat();
        }
        return null;
    }

}
